import globals from "globals"
import pluginJs from "@eslint/js"
import tseslint from "typescript-eslint"
import pluginReact from "eslint-plugin-react"
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended"
import reactHooks from "eslint-plugin-react-hooks"
import reactRefresh from "eslint-plugin-react-refresh"

export default [
    { ignores: ["dist", "node_modules", ".vscode", ".git", "ios", "android", "*.zip", "*.config.js", "*.yaml", "tsconfig.json"] },
    { files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"] },
    { languageOptions: { globals: globals.browser } },
    pluginJs.configs.recommended,
    ...tseslint.configs.recommended,
    pluginReact.configs.flat.recommended,
    eslintPluginPrettierRecommended,
    {
        name: "react-eslint",
        files: ["src/*.{js,jsx,ts,tsx"],
        plugins: {
            react: pluginReact,
            "react-hooks": reactHooks,
            "react-refresh": reactRefresh
        },
        languageOptions: {
            ...pluginReact.configs.recommended.languageOptions
        },
        rules: {
            ...pluginReact.configs.recommended.rules
        }
    },
    {
        settings: {
            react: {
                version: "detect"
            }
        }
    }
]
